﻿using UnityEngine;
using System.Collections;
using IndieStudio.BugsBang.Utility;

///Developed By Indie Studio
///https://assetstore.unity.com/publishers/9268
///www.indiestd.com
///info@indiestd.com

namespace IndieStudio.BugsBang.Game
{
	[DisallowMultipleComponent]
	public class Dialog : MonoBehaviour
	{
		/// <summary>
		/// The animator of the dialog.
		/// </summary>
		public Animator animator;

		/// <summary>
		/// The visible flag.
		/// </summary>
		[HideInInspector]
		public bool visible;

		void Start ()
		{
			if (animator == null) {
				animator = GetComponent<Animator> ();
			}
		}

		/// <summary>
		/// Show the dialog.
		/// </summary>
		public void Show (bool playClickSFX)
		{
			SetActiveTrue ();

			if (playClickSFX)
				AudioSources.instance.PlayButtonClickSFX ();
			
			BlackArea.instance.Show ();
			animator.SetBool ("Off", false);
			animator.SetTrigger ("On");
			visible = true;
		}

		/// <summary>
		/// Hide the dialog.
		/// </summary>
		public void Hide (bool playClickSFX)
		{
			if (playClickSFX)
				AudioSources.instance.PlayButtonClickSFX ();
			
			BlackArea.instance.Hide ();
			animator.SetBool ("On", false);
			animator.SetTrigger ("Off");
			visible = false;
			//AdsManager.instance.HideAdvertisment ();
			GameObject.FindObjectOfType<SceneStartup> ().ShowAd ();
		}

		/// <summary>
		/// Set gameobject active false.
		/// </summary>
		public void SetActiveFalse(){
			gameObject.SetActive (false);
		}

		/// <summary>
		/// Set gameobject active true.
		/// </summary>
		public void SetActiveTrue(){
			gameObject.SetActive (true);
		}

        public void TEXT1()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }
        public void TEXT2()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }
        public void TEXT3()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }

        public void TEXT4()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }

        public void TEXT5()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }

        public void TEXT6()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }

        public void TEXT8()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }

        public void TEXT9()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }

        public void TEXT10()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }

        public void TEXT11()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }

        public void TEXT12()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }

        public void TEXT13()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }

        public void TEXT14()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }

        public void TEXT15()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }

        public void TEXT16()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }

        public void TEXT17()
        {
            int textNum = 1;
            if (textNum == 1)
            {
                textNum = 2;
            }
        }
    }
}